<?php

namespace Controller\Single;

class GetComments extends \Controller\Base {

	public function actionIndex() {
		$articleId = $this->getInt('articleId');
		if (!$articleId) {
			$this->throwException('参数错误');
		}
		$pager = new \Lib\Core\Pager();
		$pager->currentPage = $this->getInt('page', 1);
		$pager->scriptFunc = 'view.page';
		$result = \Business\Article::instance()->getCommentsByArticleId($articleId, $pager);
		$this->assign('pager', $pager);
		$this->assign('result', $result);
		$this->display();
	}
}